import request from '@/utils/request'
import TimeCalculation from '@/utils/TimeCalculation.js'

//获取机构学生列表
export function getDeptStudentList(data) {
    return request({
        url: '/api/platform/v2/getDeptStudentList?deptId=' + data.deptId + "&name=" + data.name,
        method: 'post',
        headers: {
            isToken: true
        },
        data
    })
}

//获取机构学生的基本信息
export function getStudentBaseData(data) {
    return request({
        url: '/api/platform/v2/getStudentBaseData?studentId=' + data.studentId,
        method: 'post',
        headers: {
            isToken: true
        },
        data
    })
}

//获取学生评估记录列表
export function getStudentRecordList(data) {
    return request({
        url: '/api/platform/v2/getStudentRecordList?studentId=' + data.studentId,
        method: 'post',
        headers: {
            isToken: true
        },
        data
    })
}

//获取课程计划
export function getStudentPlan(data) {
    return request({
        url: '/api/platform/v2/getStudentPlan?studentId=' + data.studentId,
        method: 'post',
        headers: {
            isToken: true
        },
        data
    })
}

//一键审核通过
export function studentPlanAllPass(data) {
    return request({
        url: '/api/platform/v2/studentPlanAllPass?planId=' + data.planId,
        method: 'post',
        headers: {
            isToken: true
        },
        data
    })
}

//审核通过
export function studentPlanPass(data) {
    return request({
        url: '/api/platform/v2/studentPlanPass?planId=' + data.planId,
        method: 'post',
        headers: {
            isToken: true
        },
        data
    })
}

//拒绝
export function studentPlanRefuse(data) {
    return request({
        url: '/api/platform/v2/studentPlanRefuse?planId=' + data.planId,
        method: 'post',
        headers: {
            isToken: true
        },
        data
    })
}

//发送家长
export function sendPlan(data) {
    return request({
        url: '/api/platform/v2/sendPlan?planId=' + data.planId,
        method: 'post',
        headers: {
            isToken: true
        },
        data
    })
}


//课程计划保存修改
export function editPlaById(data) {
    return request({
        url: '/api/platform/v2/editRehabilitationPlan?planId='+data.planId+"&rehabilitationPlan="+data.rehabilitationPlan,
        method: 'post',
        headers: {
            isToken: true
        },
        data
    })
}

//课程计划保存修改
// export function editPlaById(data) {
//     return request({
//         url: '/api/platform/v2/editRehabilitationPlan?planId=' + data.planId + "&rehabilitationPlan=" + data.rehabilitationPlan,
//         method: 'post',
//         headers: {
//             isToken: true
//         },
//         data
//     })
// }

//课程计划保存修改
export function getStudentTeachPlan(data) {
    const queryString = TimeCalculation.objectToQueryString(data);
    return request({
        url: '/api/platform/v2/getStudentTeachPlan?' + queryString,
        method: 'post',
        headers: {
            isToken: true
        },
        data
    })
}

//课程计划保存修改
export function getTeachPlanSign(data) {
    return request({
        url: '/api/platform/v2/getTeachPlanSign?planId=' + data.planId,
        method: 'post',
        headers: {
            isToken: true
        },
        data
    })
}

// 获取学生PEP-3成效对比（近三次记录）
export function getPep3RecordCompare(studentId) {
    return request({
        url: 'api/platform/v2/getPep3RecordCompare?studentId=' + studentId,
        method: 'post',
        headers: {
            isToken: true
        },
    })
}

// 获取学生PDMS-2成效对比（近三次记录）
export function getPdms2RecordCompare(studentId) {
    return request({
        url: 'api/platform/v2/getPdms2RecordCompare?studentId=' + studentId,
        method: 'post',
        headers: {
            isToken: true
        },
    })
}
// 获取学生课表(封装数据,可选)
export function getStudentTimetablePackage(studentId,searchDate) {
    return request({
        url: 'api/platform/v2/getStudentTimetablePackage?studentId=' + studentId+"&searchDate=" + searchDate,
        method: 'post',
        headers: {
            isToken: true
        },
    })
}
export function getStudentCoursePriceList(studentId,startDate,endDate) {
    return request({
        url: 'api/platform/v2/getStudentCoursePriceList?studentId='+studentId+'&startDate=' + startDate + '&endDate=' + endDate,
        method: 'post',
        headers: {
            isToken: true
        },
    })
}
